home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2206 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.0 KB  |  59 lines

  1. Path: utopia.hacktic.nl!not-for-mail
  2. From: Mike Tavares <MIKET@cdynamics.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: How do I prevent deleting of an object that is still being used?
  5. Date: 16 Jan 1996 14:35:19 +0100
  6. Organization: Hack-Tic International, Inc.
  7. Sender: remailer@utopia.hacktic.nl
  8. Message-ID: <4dg9in$s5h@utopia.hacktic.nl>
  9. NNTP-Posting-Host: utopia.hacktic.nl
  10. Comment: This message was forwarded by an automated remailing service.
  11. Comment: No attempt was made to verify the sender's identity.
  12. Comment: Please report misuse to <postmaster@utopia.hacktic.nl>
  13.  
  14.  
  15. I have some classes:
  16.  
  17. class menuItem
  18.     {
  19.     ...
  20.  
  21.     }
  22.  
  23.  
  24.  
  25. class   menu
  26.     {
  27.  
  28.     list<menuItem>  theItems    // the items that are on this menu.
  29.  
  30.     Register( menuItem  &anItem );
  31.  
  32.     }
  33.  
  34.  
  35. A menuItem can be on more than one menu.  When a menu is deleted it 
  36. should delete all its menuItems UNLESS they are on another menu.  What is 
  37. the typical way of setting this up.  I've heard of "contact" objects and 
  38. "plug and socket" objects but I've never seen an implementation
  39. pattern. any help is appreciated.
  40.  
  41. =MikeT
  42.  
  43. PS.  I'm posting from an remailer because my providers outgoing news is 
  44. broken,  I get new articles just fine and you can reply to this article 
  45. and it will be addressed to me directly.  Thanks again.
  46.  
  47.  ---------------------------------------------------------------------
  48. | Mike Tavares         | miket@cdynamics.com    |                     |
  49. | Software Engineer    |                        | If you're not lead  |
  50. |      -----           |      -----             | dog the view never  |
  51. | Computer Dynamics    | (803) 627-8800         | changes.            |
  52. | 7640 Pelham Rd       |       EXT - 232        |                     |
  53. | Greenville, SC 29615 | Fax. (803) 675-0106    |   Email for PGP key |
  54. |==================================================================== |
  55. |            Computer Dynamics - The Flat Panel Experts               |
  56.  ---------------------------------------------------------------------
  57.  
  58.  
  59.